package demo5

type Subjecter interface {
	Do() string
}

type RealSubjecter struct {
	name string
}

func NewRealSubjecter(name string) *RealSubjecter {
	return &RealSubjecter{
		name: name,
	}
}

func (r *RealSubjecter) Do() string {
	return r.name
}

type Proxy struct {
	Subjecter
}

func NewProxy(r Subjecter) *Proxy {
	return &Proxy{Subjecter: r}
}
func (p *Proxy) Do() string {
	// do-something
	return p.Subjecter.Do()
	// do-something
}
